package com.sync.data.mce.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.sync.data.base.BaseEntity;
import com.sync.data.common.annotation.FieldProps;
import com.sync.data.common.annotation.FieldType;
import com.sync.data.common.annotation.RenderAs;
import com.sync.data.common.annotation.RenderType;
import com.sync.data.common.obj.annoation.ObjectPrefix;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Entity;
import javax.persistence.Transient;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

/**
 * 讲者专用字段 sxh
 */
@Getter
@Setter
@Entity
@ObjectPrefix("msko")
public class MdmSpeaker extends BaseEntity {

    @Transient
    @FieldProps(type = FieldType.STRING, label = "大区",icon = "area" )
    private String hcpRegion;

    @FieldProps(type = FieldType.STRING, label = "主讲课题",icon = "questionnaire")
    private String speakerSubjects;

    @FieldProps(type = FieldType.STRING, label = "联系方式",icon = "logo-contact")
    private String hcpPhone;

    @FieldProps(type = FieldType.DICT, label = "服务类型", renderType = RenderType.MultipleSelect,icon = "logo-list")
    private String serviceType;


    @Transient
    @FieldProps(type = FieldType.STRING, label = "对接人",icon = "logo-user")
    private String contactPerson;

    @Transient
    @FieldProps(type = FieldType.STRING, label = "对接人电话",icon = "logo-contact")
    private String contactPersonPhone;

    @FieldProps(type = FieldType.STRING, label = "备注",icon = "logo-description")
    private String remarks;

    @FieldProps(type = FieldType.STRING, label = "讲者标签",icon = "logo-discussion")
    private String speakerLabel ;

    @FieldProps(type = FieldType.DICT, label = "讲者评级", renderType = RenderType.Select,icon = "level")
    private String paidTiers;

    @FieldProps(type = FieldType.DICT, label = "是否签署协议", renderType = RenderType.Select,icon = "warning")
    private String signAgreement;

    @FieldProps(type = FieldType.DICT, label = "协议类型", renderType = RenderType.Select,icon = "list")
    private String agreementType;

    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @FieldProps(type = FieldType.DATE,label = "服务协议开始时间",renderType = RenderType.DatePicker,icon = "month")
    private Date serAgreStaTime;

    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @FieldProps(type = FieldType.DATE,label = "服务协议结束时间",renderType = RenderType.DatePicker,icon = "month")
    private Date serAgreEndTime;

    @FieldProps(type = FieldType.STRING, label = "执业人员姓名",sourceObject = " MdmHcp", renderField = "mdmHcp", renderType = RenderType.SourcePicker,icon = "account",notNull = true)
    private String hcpId;


    @Transient
    @FieldProps(type = FieldType.STRING, label = "客户编码",reference = "mdmHcp.hcpCode",readOnly = true)
    private String hcpCode;

    @Transient
    @FieldProps(type = FieldType.STRING, label = "姓名",reference = "mdmHcp.hcpName",readOnly = true)
    private String hcpName;

    @Transient
    @FieldProps(type = FieldType.STRING, label = "所属机构编码",reference = "mdmHcp.mdmHosp.hcoCode",readOnly = true)
    private String hcoCode;

    @Transient
    @FieldProps(type = FieldType.STRING, label = "机构名称",reference = "mdmHcp.mdmHosp.name",readOnly = true)
    private String hcoName;

    @Transient
    @FieldProps(type = FieldType.DICT, label = "性别",reference = "mdmHcp.hcpGender",readOnly = true,renderType = RenderType.Select,renderField  = "hcpGenderDict")
    private String hcpGender;

    @Transient
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @FieldProps(type = FieldType.DATE,label = "生日",renderType = RenderType.DatePicker,reference = "mdmHcp.hcpBirthday",readOnly = true)
    private Date hcpBirthday;

    @Transient
    @FieldProps(type = FieldType.STRING, label = "挂牌科室",reference = "mdmHcp.listedDepartment",readOnly = true)
    private String listedDepartment;

    @Transient
    @FieldProps(type = FieldType.DICT, label = "标准科室",reference = "mdmHcp.departName",readOnly = true,renderType = RenderType.Select,renderField  = "departNameDict")
    private String departName;


    @Transient
    @FieldProps(type = FieldType.DICT, label = "职务",reference = "mdmHcp.hcpBizTitle",readOnly = true,renderType = RenderType.Select,renderField  = "hcpBizTitleDict")
    private String hcpBizTitle;

    @Transient
    @FieldProps(type = FieldType.DICT, label = "职称",reference = "mdmHcp.hcpProfessionalTitle",readOnly = true,renderType = RenderType.Select,renderField  = "hcpProfessionalTitleDict")
    private String hcpProfessionalTitle;



    @Transient
    @FieldProps(type = FieldType.DICT, label = "学术头衔",reference = "mdmHcp.academicTitle",readOnly = true,renderType = RenderType.Select,renderField  = "academicTitleDict")
    private String academicTitle;

    @Transient
    @FieldProps(type = FieldType.STRING, label = "社会任职",reference = "mdmHcp.socialAppointments",readOnly = true)
    private String socialAppointments;

    @Transient
    @FieldProps(type = FieldType.DICT, label = "医生类型",reference = "mdmHcp.hcpType",readOnly = true,renderType = RenderType.Select,renderField  = "hcpTypeDict")
    private String hcpType;


    @Transient
    @FieldProps(type = FieldType.DICT, label = "执业证书类型",reference = "mdmHcp.practisingCertificateType",readOnly = true,renderType = RenderType.Select,renderField  = "practisingCertificateTypeDict")
    private String practisingCertificateType;

    @Transient
    @FieldProps(type = FieldType.STRING, label = "执业证书编码",reference = "mdmHcp.practisingCertificateCode",readOnly = true)
    private String practisingCertificateCode;

    @Transient
    @FieldProps(type = FieldType.DICT, label = "教育背景",reference = "mdmHcp.eduBkgd",readOnly = true,renderType = RenderType.Select,renderField  = "eduBkgdDict")
    private String eduBkgd;


    @Transient
    @FieldProps(type = FieldType.DICT, label = "专业经历",reference = "mdmHcp.workExperience",readOnly = true,renderType = RenderType.Select,renderField  = "workExperienceDict")
    private String workExperience;

    @Transient
    @FieldProps(type = FieldType.STRING, label = "毕业院校",reference = "mdmHcp.university",readOnly = true)
    private String university;

    @Transient
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @FieldProps(type = FieldType.DATE,label = "毕业时间",renderType = RenderType.DatePicker,reference = "mdmHcp.graduateTime",readOnly = true)
    private Date graduateTime;

    @Transient
    @FieldProps(type = FieldType.STRING, label = "擅长",reference = "mdmHcp.hcpPriSpecialty",readOnly = true)
    private String hcpPriSpecialty;

    @Transient
    @FieldProps(type = FieldType.STRING, label = "简介",reference = "mdmHcp.briefIntroduction",readOnly = true)
    private String briefIntroduction;

    @Transient
    @FieldProps(type = FieldType.DICT, label = "状态",reference = "mdmHcp.hcpStatus",readOnly = true,renderType = RenderType.Select,renderField  = "hcpStatusDict")
    private String hcpStatus;

    @Transient
    @FieldProps(type = FieldType.STRING, label = "状态原因",reference = "mdmHcp.statusReason",readOnly = true)
    private String statusReason;


    @OneToOne(fetch= FetchType.LAZY)
    @JoinColumn(name = "hcpId", referencedColumnName = "id", insertable = false, updatable = false)
    @NotFound(action = NotFoundAction.IGNORE)
    private MdmHcp mdmHcp;

//---新增附件*5
}

